import request from '@/utils/request'

export function groupTreeList() {
  return request({
    url: '/hawk-eye/group/tree',
    method: 'get'
  })
}

export function groupList() {
  return request({
    url: '/hawk-eye/group/list',
    method: 'get'
  })
}

export function groupDetail(id) {
  return request({
    url: '/hawk-eye/group/detail/' + id,
    method: 'get'
  })
}

export function serviceList(query) {
  return request({
    url: '/hawk-eye/service/page',
    method: 'get',
    params: query
  })
}

export function userList() {
  return request({
    url: '/hawk-eye/service/user-list',
    method: 'get'
  })
}

export function userListNotSelf() {
  return request({
    url: '/hawk-eye/service/user-list-not-self',
    method: 'get'
  })
}

export function webhookList() {
  return request({
    url: '/hawk-eye/webhook/list',
    method: 'get'
  })
}

export function addService(data) {
  return request({
    url: '/hawk-eye/service/save',
    method: 'post',
    data: data
  })
}

export function serviceDetail(id) {
  return request({
    url: '/hawk-eye/service/detail/' + id,
    method: 'get'
  })
}

export function updateService(data) {
  return request({
    url: '/hawk-eye/service/update',
    method: 'put',
    data: data
  })
}


export function removeService(id) {
  return request({
    url: '/hawk-eye/service/remove/' + id,
    method: 'delete'
  })
}

export function changeServiceStatus(data) {
  return request({
    url: '/hawk-eye/service/change-status',
    method: 'put',
    data: data
  })
}

export function serviceNameList() {
  return request({
    url: '/hawk-eye/service/name-list',
    method: 'get'
  })
}
